M98 P"0:/sys/led/resetstatus.g"

; Prompt user to confirm starting the test
M291 R"Start Test 1" P"Do you want to start Test 1?" K{"Start Test","Cancel"} S4

; Check if user selected to start the test (index 0 = Start Test, index 1 = Cancel)
if input == 1
	abort "Test cancelled by user."

; Check voltage for both boards
if boards[0].vIn.current < 23 || boards[0].vIn.current > 24.8
	M98 P"0:/sys/led/fault.g"
	abort "Error: Board 0 voltage out of range: " ^ boards[0].vIn.current ^ "V"

; Test Voltage // add 5V PSU test
M98 P"0:/macros/System/Calibration/QC/Tests/Voltage"

; LED Test
M98 P"0:/macros/System/Calibration/QC/Tests/LED"

; Bed Heater & Chamber Heater and Fans Test
M98 P"0:/macros/System/Calibration/QC/Tests/Bed & Chamber Heaters Test"

; Fans & Heaters Test
M98 P"0:/macros/System/Calibration/QC/Tests/Fans & Heaters"

; XYZ - Motor Direction & Connection Test
M98 P"0:/macros/System/Calibration/QC/Tests/Motor Direction"

; Z screws fixing
M98 P"0:/macros/System/Calibration/QC/Tests/Z screws fixing"

; Z - Binding Test
M98 P"0:/macros/System/Calibration/QC/Tests/Z - Binding"

; Endstop Test
M98 P"0:/macros/System/Calibration/QC/Tests/Endstops Test x10"

; Homing Test
M98 P"0:/macros/System/Calibration/QC/Tests/Homing"

; Probes Test
M98 P"0:/macros/System/Calibration/QC/Tests/Probe"

; Calibrate Z - Probe // Servo rotation test // Z-Probe Pickup Angle // Height // Z-Probe Pickup Position
M98 P"0:/macros/System/Calibration/Z Probe/Probe Calibration"

; Test completion notification
M291 R"Test 1 Complete" P"Test 1 has finished successfully." S1 T20